using Com.Scm.Dao;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace Com.Scm.Sys.Vote;

/// <summary>
/// 投票表
/// </summary>
[SugarTable("scm_vote_header")]
public class VoteHeaderDao : ScmDataDao
{
    /// <summary>
    /// 投票标题
    /// </summary>
    [Required]
    [StringLength(90)]
    public string title { get; set; }

    /// <summary>
    /// 投票类型（单选、多选）
    /// </summary>
    [Required]
    public VoteTypeEnums type { get; set; }

    /// <summary>
    /// 开始时间
    /// </summary>
    [Required]
    public DateTime start_time { get; set; }

    /// <summary>
    /// 结束时间
    /// </summary>
    [Required]
    public DateTime end_time { get; set; }

    /// <summary>
    /// 防刷规则（IP限制）
    /// </summary>
    [Required]
    public bool swipe_rule { get; set; } = true;

    /// <summary>
    /// 文件地址
    /// </summary>
    public string file_url { get; set; }

    /// <summary>
    /// 规则
    /// </summary>
    public string summary { get; set; }

    [SqlSugar.SugarColumn(IsIgnore = true)]
    public List<VoteDetailDao> details { get; set; }
}